package org.aceor.tennis.common.enums;

/**
 * Created by lxue on 16/5/14.
 */
public enum PlayStatus {
    UNDERWAY("进行中", 0),
    CANCELLED("已被取消", 1),
    FINISHED("已结束", 2);

    private String desc;
    private Integer value;

    PlayStatus(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getValue() {
        return value;
    }

    public static PlayStatus valueof(int value) {
        switch (value) {
            case 0:
                return UNDERWAY;
            case 1:
                return CANCELLED;
            case 2:
                return FINISHED;
            default:
                throw new IllegalArgumentException();
        }
    }
}
